/*
Copyright [2020] [https://www.xiaonuo.vip]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Snowy采用APACHE LICENSE 2.0开源协议，您在使用过程中，需要注意以下几点：

1.请不要删除和修改根目录下的LICENSE文件。
2.请不要删除和修改Snowy源码头部的版权声明。
3.请保留源码和相关描述文件的项目出处，作者声明等。
4.分发源码时候，请注明软件出处 https://gitee.com/xiaonuobase/snowy-layui
5.在修改包名，模块名称，项目代码等时，请注明软件出处 https://gitee.com/xiaonuobase/snowy-layui
6.若您的项目无法满足以上几点，可申请商业授权，获取Snowy商业授权许可，请在官网购买授权，地址为 https://www.xiaonuo.vip
 */
package com.ruoyi.common.exception;


import com.ruoyi.common.annotation.ExpEnumType;
import com.ruoyi.common.constant.ExpEnumConstant;
import com.ruoyi.common.factory.ExpEnumCodeFactory;

/**
 * 服务器内部相关异常枚举
 *
 * @author xuyuxiang
 * @date 2020/3/18 19:19
 */
@ExpEnumType(module = ExpEnumConstant.SNOWY_CORE_MODULE_EXP_CODE, kind = ExpEnumConstant.SERVER_EXCEPTION_ENUM)
public enum ServerExceptionEnum implements AbstractBaseExceptionEnum {

    /**
     * 当前请求参数为空或数据缺失
     */
    REQUEST_EMPTY(1, "当前请求参数为空或数据缺失，请联系管理员"),

    /**
     * 服务器出现未知异常
     */
    SERVER_ERROR(2, "服务器出现异常，请联系管理员"),

    /**
     * 常量获取存在空值
     */
    CONSTANT_EMPTY(3, "常量获取存在空值，请检查sys_config中是否配置"),

    SUCCESS(0,"调用成功"),
    UNKNOWN(1000,"未知异常"),
    SYSTEM_ERROR(1001,"系统繁忙，请稍候重试"),
    PARAM_ERROR(1002,"参数错误"),
    NOREGISTER_ERROR(1003,"用户未注册"),
    PASSWORD_ERROR(1004,"密码错误"),
    USER_FROZEN(1005,"商户违反平台相关规定已被冻结"),
    NOCHANNEL_ERROR(1006, "暂无可用通道"),
    NOTEXIST_ORDER(1007, "订单不存在"),
    UPDATE_USER_FAILED(1008, "更新用户信息失败"),
    FROZEN_USER_FAILED(1009, "冻结用户失败"),
    OP_ERROR(1010, "操作处理失败"),
    ADD_ORDER_ERROR(1011, "发起付款失败"),
    CHANNEL_ERROR(1012, "通道不存在或者不可用"),
    LOGIN_FAILED(1013, "用户名不存在或密码错误"),
    NOT_PAY_SUCC(1014, "no"),
    ORDER_STATUS_ERROR(1015, "订单状态错误"),
    PAY_TIMEOUT_ERROR(1016, "订单支付超时"),
    NO_AVAILABLE_RECIPIENT(1017, "没有在线且可用的收款号"),
    EXISTS_RECIPIENT(1018, "收款号已存在"),
    NO_LOGIN(1019, "请先登录"),
    REPEAT_ADD_ACCOUNT(1020, "重复开户"),
    NO_ACCOUNT(1021, "账户未开通"),
    RECHARGE_ERROR(1022, "充值失败"),
    ROBOT_VALID_ERROR(1023, "机器人校验失败"),
    MAX_MONEY_WITHDRAW(1024, "最多可提现%s元"),
    NOTENOUGH_MONEY(1025, "可用余额不足"),
    NOTENOUGH_FROZEN(1026, "可解冻的冻结金额不足"),
    OLDPWD_ERROR(1027, "原密码错误"),
    NO_UID(1028,"uid不存在"), NOTIFY_NOSUCC(1029, "返回内容不是大写SUCCESS，请联系对接技术检查回调接口"),
    ORDER_NOT_PAYSUCC(1030, "订单不是支付成功状态"),
    NO_AVAILABLE_AMOUNT(1031, "当前没有可浮动金额使用，请稍后再试"),
    NO_RECORD(1032, "要操作的记录不存在或已被删除"),
    ONLY_TIMEOUT_PAYSUCC(1033, "只能处理用户超时支付的异常订单"),
    NOTMATCH_RECIPIENT(1034, "输入的收款号不正确"),
    NOTMATCH_REALMONEY(1035, "到账金额与实际金额不匹配"),
    ESIXTS_LOGINNAME(1036, "用户名已存在"),
    ESIXTS_PHONE(1037, "手机号已存在"),
    ESIXTS_EMAIL(1038, "邮箱已存在"),
    NOVALID_OP(1039, "对不起，当前账号没有权限进行该操作"),
    TEST_ORDER_LIMIT(1040,"请不要频繁下单，5秒后再试"),
    ORDER_STATUS_ERROR2(1042, "订单已关闭或已经支付成功"),
    NOT_RECIPIENT(1043, "该收款号不存在"),
    JHM_REQUIRE_PWD(1044, "银联条码付类型必须传入密码"),
    JHM_LOGIN_FAIL(1045, "银联条码付登录失败，请验证账号和密码是否正确"),
    ALIPAY_SERVER_ERROR(1046, "支付宝接口调用异常"),
    ERROR_TOKEN(1047,"输入的token无效"),
    NOT_MY_AGENTS(1048, "仅允许直属代理操作"),
    ORDERID_FORMAT_ERROR(1049, "订单号格式错误"),
    NO_WITHDRAW_UID(1050, "字段withdrawUID不能为空"),
    NO_TEST_USER(1051, "没有测试商户，请在商户管理添加"),
    EXISTS_CARD_NO(1052,"卡号已存在"),
    NOEXISTS_CARD_NO(1053, "卡号不存在"),
    MIN_PER_WITHDRAW(1054, "单笔最小提现金额为%s元"),
    MAX_PER_WITHDRAW(1055, "单笔最大提现金额为%s元"),
    ORDER_LIMIT_MIN_MONEY(1056, "通道%s的单笔最小下单金额为%s元"),
    ORDER_LIMIT_MAX_MONEY(1057, "通道%s的单笔最大下单金额为%s元"),
    MUST_SET_SHOPNICK(1058, "店长昵称必须设置"),
    EXISTS_SHOPNICK(1059, "该店长昵称已经存在"),
    NOT_INIT_PAYPWD(1060, "支付密码尚未设置，请在右上角点击你的商户名-设置支付密码"),
    JDYK_ZSY_BIND_FAIL(1062, "绑定中石油卡失败"),
    JDYK_ZSH_BIND_FAIL(1062, "绑定中石化卡失败"),

    GOOGLE_VALID_ERROR(1063, "谷歌校验失败"),
    DELETE_VALID_ERROR(1064, "还有未超时的订单，无法删除"),
    ORDER_NOTPAY_ERROR(1064, "订单未支付"),
    ERR_ADD_JD_DFACCOUNT(1065, "电费账户添加失败"),
    NO_AVAILABLE_JD_DF_RECIPIENT(1066, "没有在线且可用的收款号或者输入的金额小于电费欠费余额"),
    KUAIDI_ADD_ORDER_ERROR(1067, "发起付款失败:"),
    MER_ORDER_EXSIT(1068, "商户订单号已经存在"),
    SIGN_ERROR(1069,"签名错误"),
    NOT_RIGHT_STATUS_ORDER(1071, "人工补单只能补超时和待支付的订单"),
    SUCC_STATUS_ORDER(1072, "该订单已支付成功,无需补单！！"),
    NOTIFY_FAIL(1072, "订单重发3次通知后仍然失败！"),

    ERR_PAYPWD(1061, "支付密码错误");


    private final Integer code;

    private final String message;

    ServerExceptionEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return ExpEnumCodeFactory.getExpEnumCode(this.getClass(), code);
    }

    @Override
    public String getMessage() {
        return message;
    }

}
